<{include file ="header.tpl"}>
<{include file ="navibar.tpl"}>
<{include file ="sidebar.tpl"}>
<!-- START 以上内容不需更改，保证该TPL页内的标签匹配即可 -->
<{$osadmin_action_alert}>
<{$osadmin_quick_note}>

<form class="form_search" action="" method="GET" style="margin-bottom:0px">
    <div style="float:left;margin-right:5px">
        <label> 选择出庫时间 </label>
        <input type="text" id="ck_date" name="ck_date" value="<{$_GET.ck_date}>" placeholder="出庫截至时间">
    </div>
    <div style="float:left;margin-right:5px">
        <label>选择入庫时间</label>
        <input type="text" id="rk_date" name="rk_date" value="<{$_GET.rk_date}>" placeholder="入庫截至時間">
    </div>
    <div style="float:left;margin-right:5px">
        <label>model號</label>
        <input type="text" name="model" value="<{$_GET.model}>" placeholder="输入產品model號">
        <input type="hidden" name="search" value="1">
    </div>
    <div class="btn-toolbar" style="padding-top:25px;padding-bottom:0px;margin-bottom:0px">
        <button type="submit" class="btn btn-primary">查询</button>
    </div>
    <div style="clear:both;"></div>
</form>

<form class="form_search" action="products_download.php" method="GET" style="margin-bottom:0px">
    <div style="float:left;margin-right:5px">
        <label> 选择出庫时间 </label>
        <input type="text" id="ck_date" name="ck_date" value="<{$_GET.ck_date}>" placeholder="出庫截至时间">
    </div>
    <div style="float:left;margin-right:5px">
        <label>选择入庫时间</label>
        <input type="text" id="rk_date" name="rk_date" value="<{$_GET.rk_date}>" placeholder="入庫截至時間">
    </div>
    <div style="float:left;margin-right:5px">
        <label>model號</label>
        <input type="text" name="model" value="<{$_GET.model}>" placeholder="输入產品model號">
        <input type="hidden" name="download" value="1">
    </div>
    <div class="btn-toolbar" style="padding-top:25px;padding-bottom:0px;margin-bottom:0px">
        <button type="submit" class="btn btn-primary">下载</button>
    </div>
    <div style="clear:both;"></div>
</form>
<div class="well">
    <ul class="nav nav-tabs">
        <li class="active"><a href="#home" data-toggle="tab">库存详情列表</a></li>
    </ul>

    <div id="myTabContent" class="tab-content">
        <div class="tab-pane active in" id="home">

            <form id="tab" method="post" action="">
                <table class="table table-striped">
                    <thead>
                    <tr>
                        <th>產品ID</th>
                        <th>產品名稱</th>
                        <th>產品型號</th>
                        <th>進貨價</th>
                        <th>進貨價貨幣類型</th>
                        <th>產品描述</th>
                        <th>當前入庫量</th>
                        <th>最近入庫時間</th>
                        <th>最近入庫狀態</th>
                        <th>當前出庫量</th>
                        <th>最近出庫時間</th>
                        <th>最近出庫狀態</th>
                        <th>当前库存</th>
                        <th>是否評估</th>
                        <th>是否新品（進十天）</th>
                        <th>進十天出庫平均值</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <{foreach name=product from=$products item=product}>
                        <tr>
                            <td><{$product.products_id}></td>
                            <td><{$product.products_name}></td>
                            <td><{$product.products_model}></td>
                            <td><{$product.products_price}></td>
                            <td><{$product.products_currency}></td>
                            <td><{$product.products_description}></td>
                            <td><{$product.products_sale_num}></td>
                            <td><{$product.products_add_date}></td>
                            <td>
                                <{if $product.products_add_status == 1 }>
                                <span style="color: green">正常入庫</span>
                                <{elseif $product.products_add_status == 2}>
                                <span style="color: red">退貨再入庫</span>
                                <{else}>
                                <span style="color: red">換貨再入庫</span>
                                <{/if}>
                            </td>
                            <td><{$product.products_sale_other}></td>
                            <td><{$product.products_due_date}></td>
                            <td>
                                <{if $product.products_sale_other > 0 }>
                                <{if $product.products_due_status == 1 }>
                                <span style="color: green">正常出庫</span>
                                <{else}>
                                <span style="color: red">換貨再出庫</span>
                                <{/if}>
                                <{else}>
                                <span style="color: green">无</span>
                                <{/if}>
                            </td>
                            <td style="color: blue;"><{$product.products_sale_num - $product.products_sale_other}></td>
                            <td>
                                <{if $product.products_evaluate > 0 }>
                                <span style="color: green">已評估</span>
                                <{else}>
                                <span style="color: red">未評估</span>
                                <{/if}>
                            </td>
                            <td>
                                <{if $product.products_new > 0 }>
                                <span style="color: green">是</span>
                                <{else}>
                                <span style="color: red">否</span>
                                <{/if}>
                            </td>
                            <td><{$product.avge}></td>
                            <td>
                                <{if $current_user != '4'}>
                                <a class="btn btn-info"
                                   href="products_modify.php?id=<{$product.products_id}>&action=modify"

                                   target="_self" title="信息修改"
                                   alt="信息修改">信息修改</a>
                                <a class="btn btn-info"
                                   href="products_add.php?id=<{$product.products_id}>&action=modify_rk"

                                   target="_self" title="入库"
                                   alt="入库">入库</a>

                                <a class="btn btn-info"
                                   href="products_due.php?id=<{$product.products_id}>&action=modify_ck"

                                   target="_self" title="出库"
                                   alt="出库">出库</a>

                                <a class="btn btn-info"
                                   href="products.php?id=<{$product.products_id}>&action=del"
                                   onclick="if(confirm('确定删除吗?')==false)return false;"
                                   target="_self" title="删除"
                                   alt="删除">删除</a>
                                <{/if}>
                            </td>
                        </tr>
                        <{/foreach}>
                    </tbody>
                </table>
                <{$page_html}>
            </form>
        </div>
    </div>

    <script>
        $(function () {
            var date = $("#ck_date");
            date.datepicker({dateFormat: "yy-mm-dd"});
            date.datepicker("option", "firstDay", 1);

        });
        $(function () {
            var date = $("#rk_date");
            date.datepicker({dateFormat: "yy-mm-dd"});
            date.datepicker("option", "firstDay", 1);
        });
    </script>

    <!---操作的确认层，相当于javascript:confirm函数--->
    <{$osadmin_action_confirm}>


    <!-- END 以下内容不需更改，请保证该TPL页内的标签匹配即可 -->
    <{include file="footer.tpl" }>